<html>
<head><meta charset="utf-8"><title>I-prioritize #72760 OsString::from_wide (in Windows OsString · t-compiler/wg-prioritization · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/index.html">t-compiler/wg-prioritization</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html">I-prioritize #72760 OsString::from_wide (in Windows OsString</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199227969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199227969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> triagebot <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199227969">(May 30 2020 at 00:25)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="2403">@WG-prioritization</span> issue <a href="https://github.com/rust-lang/rust/issues/72760">#72760</a> has been requested for prioritization.</p>



<a name="199228971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199228971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199228971">(May 30 2020 at 00:45)</a>:</h4>
<p>uhm, I'd vote for <code>P-high</code> though its implementation is around for a long time since it <strong>isn't</strong> marked as <code>unsafe</code> as Ralf mentioned</p>



<a name="199236096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199236096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199236096">(May 30 2020 at 03:39)</a>:</h4>
<p>Well, iirc it's internal? But probably mostly a matter of fixing it, IIRC <span class="user-mention" data-user-id="219747">@Simon Sapin</span> wrote the code or is probably most familiar with the wtf-8 encoding at least</p>



<a name="199245439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199245439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199245439">(May 30 2020 at 08:20)</a>:</h4>
<p>ah yes, seems the unsafe point isn't core problem here, thanks for the heads up! Also, both (<span class="user-mention" data-user-id="219747">@Simon Sapin</span>  and <span class="user-mention" data-user-id="120791">@RalfJ</span> ) think the impact/prio is low and given from their comments, I'd be ok for <code>P-low</code> or so (I thought that soundness would affect more widely), although we could use some love to unblock <a href="https://github.com/rust-lang/rust/issues/72683">#72683</a></p>



<a name="199245449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199245449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199245449">(May 30 2020 at 08:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> [said](<a href="#narrow/stream/227806-t-compiler.2Fwg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString/near/199236096)">https://rust-lang.zulipchat.com/#narrow/stream/227806-t-compiler.2Fwg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString/near/199236096)</a>:</p>
<blockquote>
<p>Well, iirc it's internal? But probably mostly a matter of fixing it, IIRC <span class="user-mention silent" data-user-id="219747">Simon Sapin</span> wrote the code or is probably most familiar with the wtf-8 encoding at least</p>
</blockquote>
<p>Aaron Turon actually wrote the code back in 2015, according to my git blame research^^</p>



<a name="199245453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199245453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199245453">(May 30 2020 at 08:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> [said](<a href="#narrow/stream/227806-t-compiler.2Fwg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString/near/199236096)">https://rust-lang.zulipchat.com/#narrow/stream/227806-t-compiler.2Fwg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString/near/199236096)</a>:</p>
<blockquote>
<p>Well, iirc it's internal? But probably mostly a matter of fixing it, IIRC <span class="user-mention silent" data-user-id="219747">Simon Sapin</span> wrote the code or is probably most familiar with the wtf-8 encoding at least</p>
</blockquote>
<p>well, the helper is internal but you can trigger the UB using just public APIs.</p>



<a name="199245504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199245504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199245504">(May 30 2020 at 08:22)</a>:</h4>
<p>I can also try to fix this based on <span class="user-mention" data-user-id="219747">@Simon Sapin</span> 's proposal, unless they already planned to do that.</p>



<a name="199246831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199246831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199246831">(May 30 2020 at 09:04)</a>:</h4>
<p>ah looks like actually Aaron just moved the code around and I should have digged further, sorry for that.</p>



<a name="199247264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199247264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199247264">(May 30 2020 at 09:18)</a>:</h4>
<p>Go ahead if you’d like to make a fix.</p>



<a name="199247348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199247348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199247348">(May 30 2020 at 09:20)</a>:</h4>
<p>I’m a bit torn between saying we should avoid having public perma-unstable functions and we should avoid duplicating fiddly bit-manipulation logic. But the logic here is not that big, and not gonna change any time soon…</p>



<a name="199261677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199261677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199261677">(May 30 2020 at 15:22)</a>:</h4>
<p>We only have 3 <code>P-low</code> and <code>I-unsound</code> issues: <a href="https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3A%22I-unsound+💥%22+label%3AP-low">https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3A%22I-unsound+💥%22+label%3AP-low</a></p>
<p>This issue seems more likely to occur than any of those issues. For triage purposes, I think this should be at least <code>P-medium</code>.</p>



<a name="199262067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199262067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199262067">(May 30 2020 at 15:31)</a>:</h4>
<p>We have a fix already so p- status isn't too important I'd say :)</p>



<a name="199271587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize%20%2372760%20OsString%3A%3Afrom_wide%20%28in%20Windows%20OsString/near/199271587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yuki Okushi <a href="https://rust-lang.github.io/zulip_archive/stream/227806-t-compiler/wg-prioritization/topic/I-prioritize.20.2372760.20OsString.3A.3Afrom_wide.20(in.20Windows.20OsString.html#199271587">(May 30 2020 at 19:15)</a>:</h4>
<p>I totally agree with Mark's opinion, but also have no objection for <code>P-medium</code> (that's why I said "P-low or so" :P )</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>